<div class="container-fluid">
  	<div class="row-fluid">
		
		<div class="span2">
		  	<div class="well sidebar-nav">
		    	<ul class="nav nav-list">
		      		<li class="nav-header">Sidebar</li>
		      		<?php 
						echo '<li class="">'.$this->Html->link('Applications',array('controller'=>'applications','action'=>'index')).'</li>';
					?>
					<?php 
						//echo '<li class="active">'.$this->Html->link('--'.$sonapp['Application']['name'],array('controller'=>'versions','action'=>'VersionsOfApplication',$sonapp['Application']['id']))."</li>";
						echo '<li class="active">'.$this->Html->link('--'.h($sonapp['Application']['name']),array('controller'=>'applications','action'=>'View',$sonapp['Application']['id']))."</li>";
					?>
					<li></br></li>
		    	</ul>
		  	</div><!--/.well -->
		</div><!--/span-->

		<div class="span10">
			<div class="container-fluid"> 
				<div class="row-fluid">
					<div class="span12">
						<?php echo $this->Session_gpp->flash();
					            //'Message.success');
					            ?>
				 	</div>
				</div>

				<div class="row-fluid">
					<div class="span12">
						<h2><?php echo __('Versions');?></h2>
					</div>
				</div>
				<div class="row-fluid">
					<div class="span12">
						<div class="navbar"/>
							<div class="navbar-inner_gpp">
								<div class="container-fluid">
									<div class="nav-collapse">
										<p><?php echo $this->Html->link(__('New Version'), array('action' => 'add'), array('class'=>'btn btn-primary btn-small')); ?></p>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>

				<div class="row-fluid">
					<div class="span12">
						<div class="page-header" style="margin-top: 10px">
							<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
								<thead>
									<tr>
											<th><?php echo __('id'); //echo $this->Paginator->sort('id');?></th>
											<th><?php echo __('name'); //echo $this->Paginator->sort('name');?></th>
											<th><?php echo __('description'); //echo $this->Paginator->sort('description');?></th>
											<th><?php echo __('Nb tables');?></th>
											<th><?php echo __('Actions');?></th>
									</tr>
								</thead>

								<tbody>	
									<?php
									foreach ($versions as $version): ?>
									<tr>
										<td><?php echo h($version['Version']['id']); ?>&nbsp;</td>
										<td><?php echo $this->Html->link(h($version['Version']['name']),array('action' => 'view', $version['Version']['id']))?>&nbsp;</td>
										<td><?php echo h($version['Version']['description']); ?>&nbsp;</td>
										<td><?php echo $this->Html->link($nbtables[$version['Version']['id']]['count'],array('controller'=>'tables','action'=>'TablesOfVersion',$version['Version']['id'])); ?>&nbsp;</td>
										<td class="center">
											<p>
												<?php echo $this->Moninput->delete(
															__('Delete'),
															$version['Version']['id'], 
															'Versions',
															__('Are you sure you want to delete # '.$version['Version']['id'].'?')
														); ?>
											</p>
										</td>
									</tr>
								<?php endforeach; ?>
								</tbody>	
							</table>
						</div>
					</div>
			</div>
		</div>
	</div>

	<!--div class="row-fluid">
		<div class="span12">
			<div class="page-header">
				<h2>SQL TRACE</h2>
				<p><?php echo $this->element('sql_dump'); ?></p>
			</div>
		</div><!--/span-->
  	</div><!--/row-->

  	<hr>

	<footer>
		<p>&copy;Copyright RLEB 2012</p>
	</footer>

</div><!--/.fluid-container-->